import os.path

import xlrd

basename = os.path.dirname(__file__)
filename = os.path.join(basename, 'data.xls')

# 打开工作簿
wb = xlrd.open_workbook(filename)

# 打开工作表
ws = wb['sheet1']

# 获取最大行/最大列
max_row = ws.nrows
max_col = ws.ncols
print(f'max_row: {max_row}, max_col: {max_col}')

# 获取单元格的值
print(ws.cell_value(0, 0))

# 获取某行/某列的值
print(ws.row_values(0))
print(ws.col_values(0))
